package de.herberlin.pss.action;

import java.util.List;

import de.herberlin.pss.ServiceLocator;
import de.herberlin.pss.model.Song;
import de.herberlin.pss.ui.SongTableModel;
/**
 * Read the songlist from the database
 * 
 * @author Hans Joachim Herbertz
 * @created 30.08.2008
 */
public class GetSonglistAction extends AbstractProgressDialogAction {

	private List<Song> songList=null;
	private SongTableModel songTableModel=null;
	
	public GetSonglistAction(SongTableModel model) {
		this.songTableModel=model;
	}
	
	@Override
	protected void doPerform() throws Exception {
		songList = ServiceLocator.getDatabaseManager().getSongList();
		if (songTableModel != null) {
			songTableModel.setSonglist(songList);
		}
	}

	@Override
	protected void doRollback() throws Exception {
		// Rollback not required
	}

}
